﻿namespace WMS6.Web.Analytics
{
    using System;
    using System.Web.UI.HtmlControls;
    using System.Web.UI.WebControls;
    using WMS6.Web;

    public class OnTheWayOrderRptQuery : BasePage
    {
        protected Button btnSearch;
        protected DropDownList ddlExternalPoID;
        protected DropDownList ddlOwnerID;
        protected DropDownList ddlPoDate;
        protected DropDownList ddlPoID;
        protected DropDownList ddlSkuClassID;
        protected DropDownList ddlSkuID;
        protected DropDownList ddlVendorID;
        protected HtmlForm F15360;
        protected HtmlInputHidden hdnActionID;
        protected HtmlInputHidden hdncalendarFlag;
        protected HtmlInputHidden hdnDataFormat;
        protected HtmlHead Head1;
        protected HtmlImage img2;
        protected HtmlImage img3;
        protected Label lblExternalPoID;
        protected Label lblMsg;
        protected Label lblOwnerID;
        protected Label lblPoDate;
        protected Label lblPoID;
        protected Label lblSkuClassID;
        protected Label lblSkuID;
        protected Label lblVendorID;
        protected HtmlLink mycss;
        protected Label one1;
        protected TextBox txtExternalPoID;
        protected TextBox txtOwnerID;
        protected TextBox txtPoDate;
        protected TextBox txtPoDate2;
        protected TextBox txtPoID;
        protected TextBox txtSkuClassID;
        protected TextBox txtSkuID;
        protected TextBox txtVendorID;

        protected void btnSearch_Click(object sender, EventArgs e)
        {
            base.Server.Transfer("OnTheWayOrderRptList.aspx", false);
        }

        private void InitDropDownLists()
        {
            base.InitQueryDDL(this.ddlPoID, 0);
            base.InitQueryDDL(this.ddlOwnerID, 0);
            base.InitQueryDDL(this.ddlSkuID, 0);
            base.InitQueryDDL(this.ddlSkuClassID, 0);
            base.InitQueryDDL(this.ddlVendorID, 0);
            base.InitQueryDDL(this.ddlExternalPoID, 0);
            base.InitQueryDDL(this.ddlPoDate, 1);
        }

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!base.IsPostBack)
            {
                base.InitPage(this.Page);
                this.InitDropDownLists();
            }
        }

        public string ExternalPoID
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtExternalPoID.Text.Trim()))
                {
                    return base.GetParamsString(this.txtExternalPoID.Text.Trim(), this.ddlExternalPoID.SelectedValue);
                }
                return "";
            }
        }

        public string OwnerID
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtOwnerID.Text.Trim()))
                {
                    return base.GetParamsString(this.txtOwnerID.Text.Trim(), this.ddlOwnerID.SelectedValue);
                }
                return "";
            }
        }

        public string PoDate
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtPoDate.Text.Trim()))
                {
                    return base.GetParamsString(this.txtPoDate.Text.Trim(), this.ddlPoDate.SelectedValue, this.txtPoDate.Text);
                }
                return "";
            }
        }

        public string PoID
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtPoID.Text.Trim()))
                {
                    return base.GetParamsString(this.txtPoID.Text.Trim(), this.ddlPoID.SelectedValue);
                }
                return "";
            }
        }

        public string SkuClassID
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtSkuClassID.Text.Trim()))
                {
                    return base.GetParamsString(this.txtSkuClassID.Text.Trim(), this.ddlSkuClassID.SelectedValue);
                }
                return "";
            }
        }

        public string SkuID
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtSkuID.Text.Trim()))
                {
                    return base.GetParamsString(this.txtSkuID.Text.Trim(), this.ddlSkuID.SelectedValue);
                }
                return "";
            }
        }

        public string VendorID
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtVendorID.Text.Trim()))
                {
                    return base.GetParamsString(this.txtVendorID.Text.Trim(), this.ddlVendorID.SelectedValue);
                }
                return "";
            }
        }
    }
}

